A TypeScript loader for Cosmiconfig
Installation
yarn add @endemolshinegroup/cosmiconfig-typescript-loader
Usage
import cosmiconfig from 'cosmiconfig';
import TypeScriptLoader from '@endemolshinegroup/cosmiconfig-typescript-loader';
const moduleName = 'myModuleName';
const explorer = cosmiconfig(moduleName, {
searchPlaces: [
'package.json',
`.${moduleName}rc`,
`.${moduleName}rc.json`,
`.${moduleName}rc.yaml`,
`.${moduleName}rc.yml`,
`.${moduleName}rc.ts`,
`.${moduleName}rc.js`,
`${moduleName}.config.ts`,
`${moduleName}.config.js`,
],
loaders: {
'.ts': TypeScriptLoader,
},
});